Skip to content

9.0 merge upstream 20170607 - #895

Merged
pedrobaeza merged 1222 commits into
OCA:9.0from
StefanRijnhart:9.0-merge_upstream_20170607
Jun 15, 2017
Merged

9.0 merge upstream 20170607#895
pedrobaeza merged 1222 commits into
OCA:9.0from
StefanRijnhart:9.0-merge_upstream_20170607

Conversation

@StefanRijnhart

Copy link
Copy Markdown
Member

No description provided.

JKE-be and others added 30 commits February 24, 2017 20:52
Template "sitemap_index_xml":
    <loc><t t-esc="url_root"/>sitemap-<t t-esc="page"/>.xml</loc>
should be:
    <loc><t t-esc="url_root"/>sitemap-<t t-esc="website_id"/>-<t t-esc="page"/>.xml</loc>

The fix in python is not elegant but allow to fix without -u of website.
This commit closes #15254

Courtesy of @hugho-ad for reporting
When computing the discount in product_id_change, before the fix

discount was equal to (new_list_price - line.price_unit) / new_list_price * 100

But line.price_unit was already rounded so the discount computed was not the
discount set in the pricelist due to rounding error.

opw:709704
message_post accepts only one id

CLA signature for igallart done at #15625

Closes #15625
The separator in the debit/credit columns of the report must contains coma
instead of dots for decimal separator (fr).
All the other columns (cf SQL query) contains coma but not this one.

Inverse the currency sign of the credit column. Otherwise the credit is negative
and sum of the balance is wrong (sum credit != debit)

Closes #15550
Change the condition from
  [...] and debit != and credit != 0
to
  [...] and (debit != or credit != 0)

as at least one of debit or credit may have an unaffected value

Without this patch a past unpaid entry will not be included in the report.

Closes #15550
If postgresql database is temporarly down, the cron thread may fail.

The cursor creation fails when trying to connect to the server which leads to
the cron thread to die (uncatched exception) and will not restart when postgres
is back.

Fixes #15666
In case an exception (programming, out of memory or any other unexpected
failure), the cron_thread would crash and not recover until server restart.

Issue #15666 was an example of failure.

Courtesy of Nils Hamerlinck
The rules "Channel: public: published only" and "Slide: public: published only"
must also be applied on portal user.

The portal user doesnt have to be allowed to create or write on slide.slide
records(introduced by 51be5bb).

opw:708499
If a pricelist PL1 set with the discount policy
`Show discount in the sale order` was based on another
pricelist PL2 with the same discount policy,
the discount applied by the second pricelist PL2
was set directly in the price, rather to be displayed
as a discount.

e.g.
PL 1: 10% on all products, show discount
PL 2: 15% on all prices of the PL1 pricelist, show discount

The discount displayed on the sales order should be
100 − (100 × (1−0,15) × (1−0,10)) = 23.5%

And the unit price of the product must remain the initial
price of the product, not the discounted price.

opw-709708
When changing of record, through the pager or the breadcrumb, the URL of the iframe
must change, as the model and id of the record is included in the URL

This wasn't done before this revision, and it could
lead to an INTERNAL SERVER ERROR in case of a deletion
followed by the loading of another record: the URL
of the iframe was still set to the former record,
and this URL crashed as the record no longer existed.

e.g.
- Create a new mass mailing, subject 1, add a random block in the content then save
- From this newly created mass mailing, Create a new mass mailing
  (directly with the create button)
  Subject 2, add a random black in the content and save
- Delete the second mass mailing
- Return in the mass mailing kanban view through the breadcrumb
- Open the mass mailing 1
- You had an internel server error, due to the fact the URL of the iframe
  was still the one of the second mass mailing.

opw-710239
This is a regression of
1cedcf6
and a following of
9a9720a

opw-709700
…r code

When you enable the IPN notifications in your Paypal account configuration,
the default IPN URL is mandatory.

You are therefore obliged to put the IPN feedback URL of Odoo
in this default URL, even if this is not used because
each transaction done by Odoo specifies the URL to which the IPN
notifications must be sent.

Because of this, if you use your Paypal account
for something else, e.g. Ebay, you receive
notifications of payments for these other transactions,
that have nothing to do with Odoo.

In such a case, Odoo returned an HTTP error status code (e.g. 500),
because Odoo couldn't find the given transactions, and
then Paypal sent emails to the Paypal owner
to tell the IPN feedback was failing. Eventually, after
several fails, Paypal automatically disabled the IPN
notifications of the given account.

With this revision, we now avoid to raise the Validation errors
in the case of the IPN feedback, and just logs it,
to avoid Paypal to sent emails to
the owner and to automatically disable the IPN notifications
if it receives transactions from other services than Odoo.

opw-702403
Setting the taxes in the accounting move entries
is important for the taxes report.

When a price difference occures in a purchase
with a product set in a perpetual inventory valuation,
the taxes set on the price difference move line should be the same
than the move line from which this price difference
is computed. Otherwise, the taxes report
do not have the whole purchase amount

opw-710228
The revision
ea9ef7c
introduced a regression:
many2one fields having one2many depending on it declared before
the declaration of the many2one itself were not unlinked
during a module uninstall.

As a result, the column in the table was not dropped,
and the table itself was not deleted either, not even truncated.

Therefore, when you tried to reinstall the module, you had data
left.

The check of the one2many dependencies must not be performed
during an uninstall. Anyway, this wasn't blocking the uninstall
of the modules,
it was just preventing the field  to be deleted, that's all.

opw-710291
- Create a SO with both 'service' and 'consu' products
- Depending on the order of the lines, the 'Delivered qty' might not be
  editable consistently.

This is because of an incorrect `return` statement in the
`_compute_qty_delivered_updateable` method.

opw-710561
To reproduce:
- Get a slow connection, e.g. activate throttling in debug mode of the
  browser.
- Create an invoice with at least one tax.
- Change a price unit.
- Click on 'Save' then repeatedly on 'Validate'

The tax lines are duplicated.

The issue comes from two identical `write` calls whose purpose is to
delete the existing tax line and create a new tax line.

The two calls are issued by the click on 'Save' and the click on
'Validate', which triggers a 'Save' since it doesn't consider the form
as being saved yet.

There were several issues:
- The buttons from the statusbar were not disabled
- The buttons were enabled too soon. They should be enabled again when
  the form is reloaded, otherwise the call to 'Validate' doesn't
  consider the form saved.

This is an extension of commit
odoo/odoo@bbbf3db581b5cf883

opw-710642
When procurements are created, they are automatically run. Avoid this
behavior, to run all procurements at the end of the process and used the
optimized JIT behavior.

opw-710007
This may happen when a dashboard contain references to deleted actions.
In the method `xml_node_to_string` in `qweb2.js`,
which is used when extending XML templates,
such as this extend of the template `PaymentScreen-Paymentlines`

the method `(new XMLSerializer()).serializeToString(node)`
magically escapes the double quotes `"` in Internet Explorer and Edge,
while this is not the case in other browsers,
therefore converting, for instance,
`this.removeAttr("class");`
to
`this.removeAttr(&quote;class&quote;);`
whhich made the rendering of the template fails.

As this method is quite critical, we do not dare
editing it to use an alternative to `XMLSerializer.serializeToString`
in a stable release

Instead, as a workaround, we just avoid the use of the double
quotes.

opw-708296
nim-odoo and others added 9 commits June 2, 2017 13:30
When the user zooms with the browser, the bottom left pads are
misaligned for some zoom levels.

By slightly reducing the width of the action pad, this can be solved for
all acceptable zoom levels.

opw-745074
If you have two invoices with a same product,
 - one having 1 unit of a product,
 - the other -1 unit of a product,

The sum of these quantities will be 0, and it will lead
to a division by zero in the former sql request.

The nullif should be applied on the sum, not on the line quantity.

opw-745073
On a pricelist, if multiple rules were set with the same
set of rules condition, the choice of which rule/item
is used was random, according to the postgres database
state.

Adding the `id` in the order force to always use the same
rule/item (the first that was created).

opw-744865
@StefanRijnhart

Copy link
Copy Markdown
Member Author

Conflict:

--- a/openerp/modules/migration.py
+++ b/openerp/modules/migration.py
@@@ -69,13 -77,11 +77,20 @@@ class MigrationManager(object)
          stageformat = {
              'pre': '[>%s]',
              'post': '[%s>]',
+             'end': '[$%s]',
          }
++<<<<<<< HEAD
 +        # In openupgrade, remove 'or pkg.installed_version is None'
 +        # We want to always pass in pre and post migration files and use a new
 +        # argument in the migrate decorator (explained in the docstring)
 +        # to decide if we want to do something if a new module is installed
 +        # during the migration.
 +        if not (hasattr(pkg, 'update') or pkg.state == 'to upgrade'):
++=======
+         state = pkg.state if stage in ('pre', 'post') else getattr(pkg, 'load_state', None)
+ 
+         if not (hasattr(pkg, 'update') or state == 'to upgrade') or state == 'to install':
++>>>>>>> odoo/9.0
              return
  
          def convert_version(version):
@@@ -116,12 -119,7 +128,16 @@@
              lst.sort()
              return lst
  
++<<<<<<< HEAD
 +        def mergedict(a, b):
 +            a = a.copy()
 +            a.update(b)
 +            return a
 +
 +        parsed_installed_version = parse_version(pkg.installed_version or '')
++=======
+         parsed_installed_version = parse_version(getattr(pkg, 'load_version', pkg.installed_version) or '')
++>>>>>>> odoo/9.0
          current_version = parse_version(convert_version(pkg.data['version']))
  
          versions = _get_migration_versions(pkg)

Resolved as

--- a/openerp/modules/migration.py
+++ b/openerp/modules/migration.py
@@@ -69,13 -77,11 +77,17 @@@ class MigrationManager(object)
          stageformat = {
              'pre': '[>%s]',
              'post': '[%s>]',
+             'end': '[$%s]',
          }
+         state = pkg.state if stage in ('pre', 'post') else getattr(pkg, 'load_state', None)
+ 
 -        if not (hasattr(pkg, 'update') or state == 'to upgrade') or state == 'to install':
 +        # In openupgrade, remove 'or pkg.installed_version is None'
 +        # We want to always pass in pre and post migration files and use a new
 +        # argument in the migrate decorator (explained in the docstring)
 +        # to decide if we want to do something if a new module is installed
 +        # during the migration.
-         if not (hasattr(pkg, 'update') or pkg.state == 'to upgrade'):
++
++        if not (hasattr(pkg, 'update') or state == 'to upgrade'):
              return
  
          def convert_version(version):
@@@ -116,12 -119,7 +125,12 @@@
              lst.sort()
              return lst
  
 +        def mergedict(a, b):
 +            a = a.copy()
 +            a.update(b)
 +            return a
 +
-         parsed_installed_version = parse_version(pkg.installed_version or '')
+         parsed_installed_version = parse_version(getattr(pkg, 'load_version', pkg.installed_version) or '')
          current_version = parse_version(convert_version(pkg.data['version']))
  
          versions = _get_migration_versions(pkg)

@StefanRijnhart

Copy link
Copy Markdown
Member Author

Setting to work in progress as this breaks on changes to the import of safe_eval (cf. #692)

@StefanRijnhart

Copy link
Copy Markdown
Member Author

Import of safe_eval fixed in commit 49cf902

@StefanRijnhart StefanRijnhart added this to the 9.0 milestone Jun 6, 2017
@mvaled

mvaled commented Jun 7, 2017

Copy link
Copy Markdown

I'm merging this in my local repo. I'm going to test it and report back.

@pedrobaeza

Copy link
Copy Markdown
Member

@mvaled any news on this?

@mvaled

mvaled commented Jun 15, 2017

Copy link
Copy Markdown

Well, I have managed to migrate the bulk of a moderate sized DB with this merged. Modules installed:

 account
 account_accountant
 account_analytic_analysis
 account_cancel
 account_chart
 account_voucher
 analytic
 analytic_contract_hr_expense
 auth_crypt
 auth_signup
 base
 base_action_rule
 base_iban
 base_import
 base_phone
 base_setup
 base_vat
 board
 bus
 calendar
 contacts
 crm
 crm_claim
 crm_profiling
 crm_todo
 database_cleanup
 decimal_precision
 document
 edi
 email_template
 fetchmail
 hr
 hr_attendance
 hr_contract
 hr_expense
 hr_holidays
 hr_payroll
 hr_payroll_account
 hr_timesheet
 hr_timesheet_invoice
 hr_timesheet_sheet
 im_chat
 im_odoo_support
 knowledge
 l10n_fr
 l10n_fr_rib
 mail
 mass_editing
 mrp
 note
 payment
 payment_transfer
 procurement
 procurement_jit
 procurement_jit_stock
 product
 project
 project_issue
 project_timesheet
 purchase
 purchase_requisition
 report
 resource
 sale
 sale_crm
 sale_mrp
 sale_service
 sales_team
 sale_stock
 share
 stock
 stock_account
 subscription
 warning
 web
 web_calendar
 web_celery
 web_diagram
 web_gantt
 web_graph
 web_kanban
 web_kanban_gauge
 web_kanban_sparkline
 website
 website_crm
 website_mail
 website_partner
 website_report
 website_sale
 web_tests
 web_view_editor

I used the following fork of OpenUpgrade for the migration: https://github.com/merchise-autrement/OpenUpgrade/tree/merchise-predevelop-9.0. I did have to tweek a couple of things just to avoid issues with our DB. All others commits are either accepted PRs, pendings PR or modifications we have made to our fork of Odoo for normal operation -- see https://github.com/merchise-autrement/odoo/tree/merchise-develop-8.0.

The only thing I have found is that after migration, some views from removed modules remain in the DB (edi, account_analytic_analysis) and break the normal operation of Odoo 9 with the migrated DB. The xml_ids were removed from ir_module_data. There's an ongoing discussion about this issue.

In summary, I think this is OK.

@pedrobaeza

Copy link
Copy Markdown
Member

Ok, merging.

@StefanRijnhart

Copy link
Copy Markdown
Member Author

@mvaled thanks for the report. Can you confirm that #594 solves the issue of the removed xml_ids?

@mvaled

mvaled commented Jun 16, 2017

Copy link
Copy Markdown

@StefanRijnhart I'll try #594 on my next round of migration (it takes me a while between each to fix several issues with our addons). I guess next Monday I will be able to do so.

@StefanRijnhart
StefanRijnhart deleted the 9.0-merge_upstream_20170607 branch November 16, 2017 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.